﻿/****************************************************
	文件：LoginMsg.cs
	作者：HuskyT
	邮箱:  1005240602@qq.com
	日期：2020/05/02 16:17   	
	功能：登录相关 消息 协议
*****************************************************/

using ProtoBuf;

namespace HTServer.Proto
{
    /// <summary>
    /// 用户注册协议
    /// </summary>
    [ProtoContract]
    public class MsgRegister : MsgBase
    {
        public MsgRegister()
        {
            ProtoType = ProtoEnum.MsgRegister;
        }

        [ProtoMember(1)] public override ProtoEnum ProtoType { get; set; }

        //客户端向服务器发送的消息：
        [ProtoMember(2)] public string Username { get; set; }
        [ProtoMember(3)] public string Password { get; set; }
        [ProtoMember(4)] public string Code { get; set; } //验证码

        [ProtoMember(5)] public RegisterType RegisterType { get; set; }

        //服务器返回给客户端的消息：
        [ProtoMember(6)] public RegisterResult Result { get; set; }
        [ProtoMember(7)] public string NewToken { get; set; } //自动登录使用的
    }

    /// <summary>
    /// 用户登录协议
    /// </summary>
    [ProtoContract]
    public class MsgLogin : MsgBase
    {
        public MsgLogin()
        {
            ProtoType = ProtoEnum.MsgLogin;
        }

        [ProtoMember(1)] public override ProtoEnum ProtoType { get; set; }

        //客户端向服务器发送的消息：
        [ProtoMember(2)] public string Username { get; set; }
        [ProtoMember(3)] public string Password { get; set; }
        [ProtoMember(4)] public string Token { get; set; } //自动登录使用的

        [ProtoMember(5)] public LoginType LoginType { get; set; }

        //服务器返回给客户端的消息：
        [ProtoMember(6)] public LoginResult Result { get; set; }
        [ProtoMember(7)] public string NewToken { get; set; } //自动登录使用的
    }
}